#include "../../inc/my_sqlite3.h"
#include "../../inc/protocol.h"
#include "../../inc/server.h"
int main(int argc,char *argv[])
{
	int servfd = -1;
	int port = 0;
	
	if(argc < 3)
	{
		printf("The argument is too few\n");
		return 1;
	}

	sscanf(argv[2],"%d",&port);
	if(port < 0 || port > 0xFFFF)
	{
		printf("The port is invalid\n");
		return 2;
	}
		
	servfd = create_server_socket(argv[1],port,9);
	server_main_loop(servfd);

	close(servfd);
	servfd = -1;
	return 0;
}
